#ifndef _BSP_CONTROL_H_
#define _BSP_CONTROL_H_

#include "driver/gpio.h"

#define  DESTROY_GPIO  GPIO_NUM_4    //这里是烧电阻GPIO
#define  PUMP_GPIO     GPIO_NUM_5    //这里是控制泵的GPIO
#define  HEAT_GPIO     GPIO_NUM_21   //这里是驱蚊加热的GPIO
#define  FAN_GPIO      GPIO_NUM_19   //这里是控制风扇的GPIO
#define  PID_HEAT_GPIO GPIO_NUM_7    //这里是PID加热用的GPIO 实际是PWM   

#define PID_PWM_PERIOD  1000

typedef enum
{
    STEP1,
    STEP2,
    STEP3,
    STEP4,
    STEP5,
    STEP6,
    STEP7,
    STEP8,
    STEP_ALL,
}WORKING_STEP_Typedef;    //工作步骤结构体


void SetPIDPWMPulseWidth(uint32_t duty);
void ControlInit(void);
void PumpControl(uint8_t En);
void HeatControl(uint8_t En);
void FanControl(uint8_t En);
void DestroyControl(uint8_t En);
void HeatPIDControl(uint8_t En);
void SetPumpLoop(uint32_t LoopCnt);
void MedicineBottleResistor(void);
void Control_Driver_Task(void *param);


void AutoBacklight(void);
void ManualBacklight(void);

void RepelTimeRepeat(void);
void RepelTimeNotRepeat(void);
void RepelTimingSett(void);
void RepelNormalSettFunction(void);

void MosAromaFunction(void);
void MosRepelEnchanceFunction(void);
void MaternalFunction(void);
void AirConditionerFunction(void);

void MosFumigateEnchanceFunction(void);
void MosFumigateNormalFunction(void);

void MosOpenBLE(void);
void MosOpenWIFI(void);
void SmartconfigOrWifiSta(void);

void RefillRepelMedicine(void);

void SwitchOn(void);
void SwitchOff(void);

extern uint8_t repel_once_mark;
extern uint8_t timing_repel_pause; //针对定时模式的
extern uint8_t stop_refresh;
extern uint8_t mark;
extern volatile uint8_t PumpRunFlag;

extern uint16_t second_cnt;  //延时启动没必要那么精确
// extern WORKING_STEP_Typedef working_step;   //状态记录用变量(小步)        ConfigParam.WorkingMode.working_mode这个是大步

extern uint8_t notify_flag;   //提示药瓶没有安装好标志
// extern uint8_t need_evacuation;  //新瓶子需要排空气标志
#endif